package com.slaffka.model;

import com.slaffka.model.user.User;

import javax.persistence.*;

/**
 * Created by IntelliJ IDEA.
 * _User: v.tsapaev
 * Date: 21.02.12
 * Time: 23:53
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "user_session")
public class UserSession {

    @Id
    @Column(name = "user_session_id")
    private String userSessionId;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private User user;

    public UserSession(){}

    public UserSession(String userSessionId, User user) {
        this();
        this.userSessionId = userSessionId;
        this.user = user;
    }

    public String getUserSessionId() {
        return userSessionId;
    }

    public void setUserSessionId(String userSessionId) {
        this.userSessionId = userSessionId;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
